/*
 * Copyright 2012 Andrea Parodi
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package eban.storebyrules;

import lombok.*;

/**
 * User: andrea.parodi
 * Date: 08/05/12
 * Time: 10.45
 */
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class User implements ReferenceFieldValue<User> {
    /*private static final FieldTypeManager<User> TYPE_MANAGER = new FieldTypeManager<User>(User.class, new FieldTypeManager.Formatter<User>() {
        @Override public String toEngineValue(User value) {
            return value.name;
        }
    }, new FieldTypeManager.Parser<User>() {
        @Override public User toRuntimeValue(Object value) {
            return new User(value.toString());
        }
    }
    ) {
    };*/
    @Getter @Setter @Key String name = "";


   /* public FieldTypeManager getTypeManagerStatic() {
        return TYPE_MANAGER;
    }
    public FieldTypeManager getTypeManager() {
        return TYPE_MANAGER;
    }*/

    @Override public String toEngine() {
        return name;
    }

    @Override public User fromEngine(String value) {
        this.name=value;
        return this;
    }
}
